package com.huang.wangpan.strategy.process;

import com.huang.wangpan.service.GetDataService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author: liminghui
 * @Date: 2020/11/7 12:37
 * @Version:
 * @Description:
 */
@Component
public class DeleteFileProcess implements CommonProcess {

    @Autowired
    GetDataService getDataService;

    private static final Logger logger = LoggerFactory.getLogger(DeleteFileProcess.class);

    @Override
    public void process(String method, HttpServletRequest request, HttpServletResponse response) {
        String filename = request.getParameter("filename");
        logger.info("DeleteFileProcess-->deleteFilename----> {}", filename);
        String currentpath = request.getParameter("currentpath");
        getDataService.deleteFile(request, currentpath + filename);
    }
}
